﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductAddEdit.aspx.cs"
    Inherits="BitPortal.Admin.Product.Product.ProductAddEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Thêm/Sửa sản phẩm</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <script type="text/javascript">
            function ChangePrice(price) {
                var oldPrice = Ext.getCmp('<%=txtOldPrice.ClientID %>');
                oldPrice.setValue(price);
                var cost = Ext.getCmp('<%=txtCost.ClientID %>');
                cost.setValue(price);
            }
            function CallToPrice() {
                var ck = Ext.getCmp('<%=ckCallToPrice.ClientID %>');
                if (ck.checked) {
                    var price = Ext.getCmp('<%=txtPrice.ClientID %>');
                    price.setValue('0');
                    var oldPrice = Ext.getCmp('<%=txtOldPrice.ClientID %>');
                    oldPrice.setValue('0');
                    var cost = Ext.getCmp('<%=txtCost.ClientID %>');
                    cost.setValue('0');
                }

            }
        </script>
        <ext:Panel ID="pnContener" runat="server" PaddingSummary="10" ButtonAlign="Center"
            Border="false" Layout="FormLayout" Width="950" AutoScroll="true" Height="500"
            Header="false" EnableViewState="true">
            <Items>
                <ext:Hidden ID="txtID" runat="server" Text="0">
                </ext:Hidden>
                <ext:Hidden ID="txtStatisticID" runat="server" Text="0">
                </ext:Hidden>
                <ext:Hidden ID="txtDiscussionGroupID" runat="server" Text="0">
                </ext:Hidden>
                <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Plain="true" AutoHeight="true" AutoDataBind="true">
                    <Items>
                        <ext:Panel ID="Panel1" runat="server" Title="Thông tin cơ bản" AutoHeight="true"
                            Padding="10" LabelWidth="100" LabelAlign="Left" Layout="Form">
                            <Items>
                                <ext:TextField ID="txtName" runat="server" AnchorHorizontal="95%" FieldLabel="Tiêu đề"
                                    EmptyText="Nhập tên sản phẩm" AllowBlank="false">
                                </ext:TextField>
                                <ext:TextArea ID="txtDescription" runat="server" AnchorHorizontal="95%" FieldLabel="Tóm tắt"
                                    EmptyText="Nhập tóm tắt" AllowBlank="false">
                                </ext:TextArea>
                                <ext:TextField ID="txtManufactor" runat="server" AnchorHorizontal="95%" FieldLabel="Hãng sản xuất"
                                    EmptyText="Nhập hãng sản xuất">
                                </ext:TextField>
                                <ext:TextField ID="txtWarranty" runat="server" AnchorHorizontal="95%" FieldLabel="Bảo hành"
                                    EmptyText="Thông tin bảo hành">
                                </ext:TextField>
                                <ext:DateField ID="datetimeDisplay" runat="server" FieldLabel="Ngày hiển thị" Width="300"
                                    Editable="false" />
                                <ext:SpinnerField ID="txtSortOrder" runat="server" Text="0" AllowDecimals="false"
                                    MinValue="0" FieldLabel="Thứ tự hiển thị" Width="195">
                                </ext:SpinnerField>
                                <ext:ComboBox ID="cbCategory" runat="server" Width="300" FieldLabel="Nhóm sản phẩm"
                                    AllowBlank="false" FireSelectOnLoad="true" AutoPostBack="true" Editable="false">
                                    <%--<DirectEvents>
                                <Change OnEvent="GetProperty" />
                            </DirectEvents>--%>
                                </ext:ComboBox>
                            </Items>
                            <Content>
                                <%--<uc:ComboProductCategory runat="server" ID="cbCategory" />--%>
                                <br />
                                <br />
                                <br />
                                <uc:FileSelecter runat="server" ID="Thumbnail" FileType="Image" FieldLabel="Ảnh đại diện"
                                    StartFolder="~/Upload/Image/Products" />
                                <br />
                                <br />
                            </Content>
                        </ext:Panel>
                        <ext:Panel ID="Panel2" runat="server" Title="Bài viết giới thiệu" AutoHeight="true"
                            Padding="10" LabelWidth="75" LabelAlign="Top" Layout="Form">
                            <Content>
                                <ext:HtmlEditor ID="txtContent" runat="server" AnchorHorizontal="100%" FieldLabel="Nội dung"
                                    LabelAlign="Top" Height="550">
                                </ext:HtmlEditor>
                            </Content>
                        </ext:Panel>
                        <ext:Panel ID="Panel6" runat="server" Title="Giá" AutoHeight="true" Padding="10"
                            LabelWidth="150" LabelAlign="Left" Layout="FormLayout">
                            <Content>
                                <ext:NumberField ID="txtPrice" runat="server" MinValue="0" Text="0" FieldLabel="Giá (VND)"
                                    DecimalSeparator="," Width="250">
                                    <Listeners>
                                        <Change Handler="ChangePrice(this.getValue());" />
                                    </Listeners>
                                </ext:NumberField>
                                <ext:NumberField ID="txtOldPrice" runat="server" MinValue="0" Text="0" FieldLabel="Giá cũ"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                                <ext:NumberField ID="txtCost" runat="server" MinValue="0" Text="0" FieldLabel="Giá thực"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                                <ext:Checkbox runat="server" ID="ckCallToPrice" FieldLabel="Liên hệ để biết giá">
                                    <Listeners>
                                        <Check Handler="CallToPrice();" />
                                    </Listeners>
                                </ext:Checkbox>
                            </Content>
                        </ext:Panel>
                        <ext:Panel ID="Panel7" runat="server" Title="Số lượng, kích thước" AutoHeight="true"
                            Padding="10" LabelWidth="150" LabelAlign="Left" Layout="FormLayout">
                            <Content>
                                <ext:SpinnerField ID="txtQuality" runat="server" MinValue="0" Text="1" FieldLabel="Số lượng"
                                    AllowDecimals="false" Width="250">
                                </ext:SpinnerField>
                                <ext:NumberField ID="txtWidth" runat="server" MinValue="0" Text="0" FieldLabel="Chiều rộng (cm)"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                                <ext:NumberField ID="txtLength" runat="server" MinValue="0" Text="0" FieldLabel="Chiều dài"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                                <ext:NumberField ID="txtHeight" runat="server" MinValue="0" Text="0" FieldLabel="Chiều cao"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                                <ext:NumberField ID="txtWeight" runat="server" MinValue="0" Text="0" FieldLabel="Khối lượng (gam)"
                                    DecimalSeparator="," Width="250">
                                </ext:NumberField>
                            </Content>
                        </ext:Panel>
                        <ext:Panel ID="Panel3" runat="server" Title="Cấu hình hiển thị" AutoHeight="true"
                            Padding="10" LabelAlign="Left">
                            <Items>
                                <ext:Container ID="Container1" runat="server" Layout="Column" Height="100">
                                    <Items>
                                        <ext:Container ID="Container2" ColumnWidth=".5" runat="server" Layout="FormLayout"
                                            LabelWidth="200">
                                            <Items>
                                                <ext:Checkbox runat="server" ID="ckIsDiscount" FieldLabel="Đang khuyến mại">
                                                </ext:Checkbox>
                                                <ext:Checkbox runat="server" ID="ckIsNew" FieldLabel="Sản phẩm mới">
                                                </ext:Checkbox>
                                                <ext:Checkbox runat="server" ID="ckIsHot" FieldLabel="Sản phẩm nổi bật">
                                                </ext:Checkbox>
                                            </Items>
                                        </ext:Container>
                                        <ext:Container ID="Container3" ColumnWidth=".5" runat="server" Layout="FormLayout"
                                            LabelWidth="200">
                                            <Items>
                                                <ext:Checkbox runat="server" ID="ckIsEnabled" FieldLabel="Duyệt" Checked="true">
                                                </ext:Checkbox>
                                                <ext:Checkbox runat="server" ID="ckAvaiable" FieldLabel="Còn hàng" Checked="true">
                                                </ext:Checkbox>
                                                <ext:Checkbox runat="server" ID="ckAllowOrder" FieldLabel="Cho phép đặt hàng" Checked="true">
                                                </ext:Checkbox>
                                            </Items>
                                        </ext:Container>
                                    </Items>
                                </ext:Container>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="Panel4" runat="server" Title="Cấu hình SEO" AutoHeight="true" Padding="10"
                            LabelAlign="Top" Layout="Form">
                            <Items>
                                <ext:TextField ID="txtMetaTitle" runat="server" AnchorHorizontal="95%" FieldLabel="Thẻ Tiêu đề"
                                    EmptyText="Nhập tiêu đề">
                                </ext:TextField>
                                <ext:TextArea ID="txtMetaKeyword" runat="server" AnchorHorizontal="95%" FieldLabel="Thẻ từ khóa"
                                    EmptyText="Nhập từ khóa">
                                </ext:TextArea>
                                <ext:TextArea ID="txtMetaDescription" runat="server" AnchorHorizontal="95%" FieldLabel="Thẻ mô tả nội dung"
                                    EmptyText="nội dung">
                                </ext:TextArea>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="Panel5" runat="server" Title="Thuộc tính" AutoHeight="true" Padding="10"
                            LabelAlign="Left" Layout="FormLayout" AnchorHorizontal="100%">
                            <Content>
                            </Content>
                        </ext:Panel>
                        <ext:Panel ID="Panel8" runat="server" Title="Statistic - Bình luận" AutoHeight="true"
                            Padding="10" LabelAlign="Top" Layout="HBoxLayout">
                            <Items>
                                <ext:Button runat="server" ID="btnStatistic" Text="Click vào đây để xem phân tích">
                                    <DirectEvents>
                                        <Click OnEvent="btnStatistic_Click">
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button runat="server" ID="btnDiscussion" Text="Click vào đây để xem bình luận">
                                    <DirectEvents>
                                        <Click OnEvent="btnDiscussion_Click">
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Panel>
                    </Items>
                </ext:TabPanel>
            </Items>
            <Buttons>
                <ext:Button ID="btnUpdate" runat="server" Text="Cập nhật" Scale="Medium">
                    <DirectEvents>
                        <Click OnEvent="btnUpdate_Click">
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:Button ID="btnInsert" runat="server" Text="Thêm" Scale="Medium" CausesValidation="true">
                    <DirectEvents>
                        <Click OnEvent="btnInsert_Click">
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:Button ID="btnCancel" runat="server" Text="Bỏ qua" Scale="Medium">
                    <Listeners>
                        <Click Handler="parent.Ext.WindowMgr.getActive().hide();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:Panel>
        <ext:Window ID="wSatistic" runat="server" Collapsible="true" Icon="Star" Title="Statistic"
            Width="635" Height="420" AutoScroll="true" Hidden="true" ButtonAlign="Center"
            AutoDataBind="false">
            <AutoLoad ShowMask="true" Mode="IFrame" />
        </ext:Window>
        <ext:Window ID="wDiscussion" runat="server" Collapsible="true" Icon="Comment" Title="Bình luận"
            Width="835" Height="500" AutoScroll="true" Hidden="true" ButtonAlign="Center"
            AutoDataBind="false">
            <AutoLoad ShowMask="true" Mode="IFrame" />
        </ext:Window>
    </div>
    </form>
</body>
</html>
